package com.walter.springai.tools;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.chat.model.ToolContext;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;

/**
 * 发送邮件
 */
@Slf4j
public class SendMailTool {

    /**
     *
     */
    @Tool(name = "sendMail", description = "给指定人发送邮件")
    public String sendMail(@ToolParam(description = "邮件接收人", required = true) String receiver,
                           @ToolParam(description = "邮件内容", required = true) String content,
                           ToolContext toolContext) {
        log.info("sendMail receiver={}, content={}", receiver, content);
        return "已将邮件成功发送给：" + receiver;
    }
}
